const components = require.context('./', true, /\.vue$/)

export const regAllComponents = Vue => {
  components
    .keys()
    .map(fileName => components(fileName))
    .forEach(({ default: cur }) => {
      const { name } = cur
      Vue.component(name, cur)
    })
}
